package com.chenjj.scala.forloop

object ForTest {

  //数字循环
  def  for1={
     for(i <- 1 to 10){
       println(i);
     }
  }


  //对象循环
 def for2 = {
    val person = Array(new Person("chenjj"),new Person("chenjj1"))

   for ( i <- person.array){
     println(i.name)
   }
 }

  def main(args: Array[String]): Unit = {
    for1
    for2
  }
}
